package net.spacebeeshooter.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import net.spacebeeshooter.main.ErrorGenerator;

public class EditDefaultListener implements ActionListener {

	private String defaultPath;
	
	public EditDefaultListener(String defaultPath) {
		this.defaultPath = defaultPath;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		try {
			new ProcessBuilder("Notepad.exe", defaultPath).start();
		} catch (IOException ex) {
			new ErrorGenerator().generateErrorMessage("default.cfg could not be loaded!");
		}
	}

}
